<template>
  <div class="container">
    <el-card style="margin:10px 0 0 10px">
      <el-row type="flex" justify="space-between" align="middle" style="margin-bottom:30px"
      ><el-col>
        <el-radio-group size="small" @change="getMonthList" v-model="act">
          <el-radio-button label="月收入"></el-radio-button>
          <el-radio-button label="月支出"></el-radio-button> </el-radio-group
      ></el-col>
      <el-col :span="7"
        ><el-date-picker
          format="yyyy年MM月"
          value-format="yyyy-M"
          v-model="month"
          type="month"
          placeholder="选择月"
          size="mini"
          @change="getMonthList"
        >
        </el-date-picker></el-col
    ></el-row>
  <el-row>
    <pic></pic>
  </el-row></el-card>
  </div>
</template>

<script>
import pic from "./draw/pic.vue";
export default {
  name: "Home",
  data() {
    return {
      month: "2023-1",
      act: "月收入",
    };
  },
  methods: {
    getMonthList() {
      if (this.act == "月收入") {
        this.$bus.$emit("changeIncomeList", this.month);
      } else {
        this.$bus.$emit("changeSpendingList", this.month);
      }
    },
  },
  components: {
    pic,
  },
};
</script>

<style scoped>
</style>